<?php

include_once './FBConnect.php';

echo print_r($_REQUEST, TRUE);

if ($_REQUEST['session_key']) {
    $fb = new FBConnect();
    $oauth = $fb->getOAuthFromSession($_REQUEST['session_key']);
    echo "<br/>Session-key: " . $_REQUEST['session_key'];
    echo "<br/>Oauth: " . $oauth;
}

//if (isset ($_REQUEST['session'])) {
//    $session = json_decode($_REQUEST['session'], TRUE);
//    echo '<br/>Session: ' . print_r($session, TRUE);
//
//    foreach ($session as $key => $value) {
//        unset ($session[$key]);
//
//
//        //cf77865a5070f2c2ba3b52cbf3371579_expires=1284375600;
//        //cf77865a5070f2c2ba3b52cbf3371579_session_key=2.lZ_sr8pqAZcc_kp2oEmyVQ__.3600.1284375600-613374451;
//        //cf77865a5070f2c2ba3b52cbf3371579_user=613374451;
//        //cf77865a5070f2c2ba3b52cbf3371579_ss=y3dHI5VJo_KTUA4u8PvVBg__;
//        //cf77865a5070f2c2ba3b52cbf3371579=fc6af233e4d14837de64444f30bccbeb
//
//        if (strcmp('uid', $key)==0) {
//            $session['cf77865a5070f2c2ba3b52cbf3371579_user'] = $value;
//        }
//        else if (strcmp('expires', $key)==0) {
//            $session['cf77865a5070f2c2ba3b52cbf3371579_expires'] = $value;
//        }
//        else if (strcmp('session_key', $key)==0) {
//            $session['cf77865a5070f2c2ba3b52cbf3371579_session_key'] = $value;
//        }
//        else if (strcmp('secret', $key)==0) {
//            $session['cf77865a5070f2c2ba3b52cbf3371579_ss'] = $value;
//        }
//        else if (strcmp('sig', $key)==0) {
//            $session['cf77865a5070f2c2ba3b52cbf3371579'] = $value;
//        }
//    }
//
//    echo '<br/>Session: ' . print_r($session, TRUE);
//}

?>
